﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Hope.Gallery.Models;
using Hope.Gallery.ViewModels;

namespace Hope.Gallery.Controllers
{
    public class HomeController : Controller
    {
        /// <summary>
        /// Home page
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            IndexModel model = new IndexModel();
            return View(model);
        }

        /// <summary>
        /// Album Details
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult AlbumDetails(int id)
        {
            IndexModel model = new IndexModel();
            model.GetAlbumById(id);

            if (model.CurrentAlbum != null)
            {
                return View(model);
            }

            return RedirectToAction("index");
        }

        /// <summary>
        /// Albums
        /// </summary>
        /// <returns></returns>
        public ActionResult Albums()
        {
            IndexModel model = new IndexModel();
            model.LoadAlbums();

            return View(model);
        }

        /// <summary>
        /// About
        /// </summary>
        /// <returns></returns>
        public ActionResult About()
        {
            return View();
        }

        /// <summary>
        /// Pagina inscriere
        /// </summary>
        /// <returns></returns>
        public ActionResult SignIn()
        {
            return View();
        }
    }

}
